package com.example.demo.设计模式.工厂模式;

/**
 * 简单工厂模式
 */
public class SimpleFactory {
    public static Product getProduct(String type) {
        Product product = null;
        if ("A".equals(type)) {
            product = new ProductA();
        }
        if ("B".equals(type)) {
            product = new ProductB();
        }
        return product;
    }
}
